package com.migu.rbac.thread;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Description TODO :
 * @Author: zj
 * @Date: 16:29 2019/7/29
 * @Version 1.0
 **/
@Component
public class Jobs {

    public static final Logger log = LoggerFactory.getLogger(Jobs.class);

    @Async
    public void tes1() {
        System.out.println(1 / 0);
    }

    @Async
    public void tes12() {
        System.out.println("tes12");
    }

    @Async
    public void tes3() {

        int j = 0;
        for (int i = 0; i < 1900; i++) {
            j++;
        }
        System.out.println(j);
    }

    @Async
    public void tes14() {
        try {
            Thread.sleep(6 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info(Thread.currentThread().getName() + "===-===============tes14");
    }

    @Async
    public void tes15() {
        System.out.println("tes15");
    }

    @Async
    public void tes16() {
        log.info(Thread.currentThread().getName() + "===-===============tes16");
    }

    @Async
    public void tes17() {
        log.info(Thread.currentThread().getName() + "===-===============tes17");
    }

}
